package com.cslg.ac.demo.entity.pet;

import com.cslg.ac.demo.util.string.StringUtil;

public class PetAdopt {

    private Integer id;
    private Integer source;
    private Integer immune;
    private String description;
    private String video;
    private String demand;


    public boolean insertValid(int descrptionLength,int demandLength){
        if(source != 0 && source != 1 && source != 2){
            return false;
        }
        if(immune != 0 && immune != 1 && immune != 2){
            return false;
        }
        if(StringUtil.haveNullOrEmpty(description) || StringUtil.lengthAbove(description,descrptionLength)){
            return false;
        }
        if(StringUtil.haveNullOrEmpty(demand) || StringUtil.lengthAbove(demand,demandLength)){
            return false;
        }
        return true;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSource() {
        return source;
    }

    public void setSource(Integer source) {
        this.source = source;
    }

    public Integer getImmune() {
        return immune;
    }

    public void setImmune(Integer immune) {
        this.immune = immune;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    public String getVideo() {
        return video;
    }

    public void setVideo(String video) {
        this.video = video;
    }

    public String getDemand() {
        return demand;
    }

    public void setDemand(String demand) {
        this.demand = demand;
    }

    @Override
    public String toString() {
        return "PetAdopt{" +
                "id=" + id +
                ", source=" + source +
                ", immune=" + immune +
                ", description='" + description + '\'' +
                ", video='" + video + '\'' +
                ", demand='" + demand + '\'' +
                '}';
    }
}
